package com.sayice.robotconflict.game.msg.data.send;

import cn.hutool.core.bean.BeanUtil;
import com.sayice.robotconflict.game.object.Robot;
import com.sayice.robotconflict.game.object.property.Coord;
import com.sayice.robotconflict.game.object.property.Direction;
import com.sayice.robotconflict.game.object.property.RewindableCoord;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 对局机器人信息
 *
 * @author shubing
 */
@Getter
@Setter
@ToString
public class GameRobotInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    
    /**
     * 机器人名
     */
    private String name;
    
    /**
     * 所属玩家ID
     */
    private String playerId;
    
    /**
     * 在玩家携带机器人中的序号 (从0开始)
     */
    private int seq;
    
    /**
     * 是否被控制
     */
    private boolean controlled;
    
    /**
     * 血量
     */
    private int blood;
    
    /**
     * 坐标
     */
    private RewindableCoord coord;
    
    /**
     * 方向
     */
    private Direction direction;
    
    /**
     * 攻击偏移
     */
    private Coord attackOffset;
    
    public GameRobotInfo() {
    }
    
    public GameRobotInfo(Robot robot) {
        BeanUtil.copyProperties(robot, this);
        playerId = robot.player.id;
    }
}
